<?php
class ModelWidget extends Widget{

	 public function render($data){

		   if(empty($data['id'])){
		   		$data['id'] = 'type';
		   }
		   if(empty($data['value'])){
		   		$data['value'] = 0;
		   }
		   if(!S("site_model")){
    		$model = M('Model')->findAll();
    		S("site_model",$model);
    	 }
		   $data['model'] = S("$site_model");
       $content = $this->renderFile('model',$data);
       return $content;

    }

}
?>
 